﻿using Lidgren.Network;
using UnityEngine;
public class NetTankActor:TankActor
{
    public override void Shooting()
    {
        base.Shooting();

        if(isLocalPlayer)
            SendShoot();
    }
    private void SendShoot()
    {
        NetOutgoingMessage om = NetHandler.Instantce.CreateMessage();

        om.Write(NetConst.OnPlayerShot);
        om.Write(this.ActorInfo.actorGUID);
        NetHandler.Instantce.SendNetMsgToAll(om, NetDeliveryMethod.ReliableOrdered);
    }

    public void OnHandleShoot(NetIncomingMessage msg )
    {
        //msg.Position = 0;
        //msg.ReadByte();
        //msg.ReadString();

        this.Shooting();
    }
}

